

public class QuackCounter implements Quackable {
	Observable observable;
	Quackable duck;
	static int numberOfQuacks;
  
	public QuackCounter (Quackable duck) {
		this.duck = duck;
		observable = new Observable(this.duck);
	}
  
	public void quack() {
		duck.quack();
		numberOfQuacks++;
		notifyObservers();
	}
 
	public static int getQuacks() {
		return numberOfQuacks;
	}
	  
	public void registerObserver(Observer observer) {
		observable.registerObserver(observer);
	}
 
	public void notifyObservers() {
		observable.notifyObservers();
	}

}
